package com.ibeeking.found.common.enums.marketing;

/**
 * @Author ibeeking
 * @Date: 2021-01-05 19:15
 * @Description: 问题类型
 */
public enum QuestionTypeEnum {
    SEL_ONE(1, "单选题"),
    SEL_MANY(2, "多选题"),
    ANSWER(3, "问答题"),
    COVER(4, "封面页"),
    END(5, "结束页面"),
    USERINFO(6, "信息采集"),
    SHOWINFO(7, "信息展示"),
    ;

    private Integer code;
    private String name;

    QuestionTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static QuestionTypeEnum getEnum(Integer code) {
        for (QuestionTypeEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj;
            }
        }
        return null;
    }
}
